#include "Msg.h"
#include "../Settings/GameSettings.h"

Msg::Msg()
{
}

int Msg::info(QString txt)
{
    return info(txt,"");
}

int Msg::info(QString txt, QString informativeText)
{
    return info("Game Manager",txt,informativeText);
}

int Msg::info(QString title, QString txt, QString informativeText)
{
    return msg(QMessageBox::Information,title,txt,informativeText,QMessageBox::Ok);
}

int Msg::ask(QString txt)
{
    return ask(txt,"");
}

int Msg::ask(QString txt, QString informativeText)
{
    return ask("Game Manager",txt,informativeText);
}

int Msg::ask(QString title, QString txt, QString informativeText)
{
    return msg(QMessageBox::Question,title,txt,informativeText,QMessageBox::Yes | QMessageBox::No);
}

int Msg::warn(QString txt)
{
    return warn(txt,"");
}

int Msg::warn(QString txt, QString informativeText)
{
    return warn("Game Manager",txt,informativeText);
}

int Msg::warn(QString title, QString txt, QString informativeText)
{
    return msg(QMessageBox::Warning,title,txt,informativeText,QMessageBox::Ok);
}

int Msg::err(QString txt)
{
    return err(txt,"");
}

int Msg::err(QString txt, QString informativeText)
{
    return err("Game Manager",txt,informativeText);
}

int Msg::err(QString title, QString txt, QString informativeText)
{
    return msg(QMessageBox::Critical,title,txt,informativeText, QMessageBox::Ok);
}

int Msg::msg(QMessageBox::Icon icon, QString title, QString txt, QString informativeTxt, QMessageBox::StandardButtons buttons)
{
    QMessageBox mb(icon,title,txt,buttons,GameSettings::me()->mostTopWnd());
    mb.setInformativeText(informativeTxt);
    return mb.exec();
}
